Skip to content

fix(mavlink): update TransponderReport flag bitmask#27878

Open
anilkir wants to merge 3 commits into
mainfrom
ak/fix-transponder-adsb-flags
Open

fix(mavlink): update TransponderReport flag bitmask#27878
anilkir wants to merge 3 commits into
mainfrom
ak/fix-transponder-adsb-flags

Conversation

@anilkir

@anilkir anilkir commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Solved Problem

TransponderReport.msg is missing MAVLink's SIMULATED, VERTICAL_VELOCITY_VALID, BARO_VALID, and SOURCE_UAT flags entirely (mavlink msg definition). The PX4_ADSB_FLAGS_RETRANSLATE bit (256) also collides with MAVLink's ADSB_FLAGS_BARO_VALID bit at the same value.

Solution

  • Moved PX4_ADSB_FLAGS_RETRANSLATE to bit 512 (unused by MAVLink's ADSB_FLAGS enum), resolving the collision
  • Added the missing flags with correct bit values.
  • Forwarded the new flags in both directions: (uORB → MAVLink) and (MAVLink → uORB).

Changelog Entry

For release notes:

Fix TransponderReport ADS-B flag bitmask to match MAVLink ADSB_FLAGS.

Alternatives

Test coverage

Context

Related links, screenshot before/after, video

@anilkir
anilkir requested a review from MaEtUgR July 13, 2026 02:35
@anilkir anilkir self-assigned this Jul 13, 2026
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:uorb uORB messages, generated interfaces, or message translation. labels Jul 13, 2026
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: -184 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +78  [ = ]       0    .debug_abbrev
  +0.0%    +401  [ = ]       0    .debug_info
  -0.0%    -223  [ = ]       0    .debug_line
    [DEL]      -4  [ = ]       0    [Unmapped]
    -0.0%    -219  [ = ]       0    [section .debug_line]
  -0.0%     -13  [ = ]       0    .debug_loclists
  +0.0%      +3  [ = ]       0    .debug_rnglists
  +0.0%    +162  [ = ]       0    .debug_str
  +1.9%    +184  [ = ]       0    [Unmapped]
  -0.0%    -184  -0.0%    -184    .text
   -22.7%     -80 -22.7%     -80    MavlinkReceiver::handle_message_adsb_vehicle()
   -24.5%    -104 -24.5%    -104    MavlinkStreamADSBVehicle::send()
  +0.0%    +408  -0.0%    -184    TOTAL

px4_fmu-v6x [Total VM Diff: -184 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +78  [ = ]       0    .debug_abbrev
  +0.0%    +401  [ = ]       0    .debug_info
  -0.0%    -223  [ = ]       0    .debug_line
   -66.7%      -4  [ = ]       0    [Unmapped]
    -0.0%    -219  [ = ]       0    [section .debug_line]
  -0.0%     -23  [ = ]       0    .debug_loclists
  +0.0%      +1  [ = ]       0    .debug_rnglists
   -66.7%      -2  [ = ]       0    [Unmapped]
    +0.0%      +3  [ = ]       0    [section .debug_rnglists]
  +0.0%    +162  [ = ]       0    .debug_str
  +3.0%    +184  [ = ]       0    [Unmapped]
  -0.0%    -184  -0.0%    -184    .text
   -22.7%     -80 -22.7%     -80    MavlinkReceiver::handle_message_adsb_vehicle()
   -24.5%    -104 -24.5%    -104    MavlinkStreamADSBVehicle::send()
  +0.0%    +396  -0.0%    -184    TOTAL

Updated: 2026-07-16T16:37:00

Comment thread msg/TransponderReport.msg Outdated
@dakejahl
dakejahl requested a review from JonasPerolini July 14, 2026 16:41
@github-actions github-actions Bot added the scope:drivers Device drivers and hardware interfaces. label Jul 16, 2026
@MaEtUgR
MaEtUgR force-pushed the ak/fix-transponder-adsb-flags branch from ebafa04 to b12684a Compare July 16, 2026 12:20
@github-actions github-actions Bot added the scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. label Jul 16, 2026
MaEtUgR
MaEtUgR previously approved these changes Jul 16, 2026

@MaEtUgR MaEtUgR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final change:

  • Restructure transponder_report message to:
    • Contain the new flags from MAVLink by @anilkir
    • follow the new parsed message definition style closer with description, units, enum options directly after the field.
  • Remove PX4 internal conflicting RETRANSLATE flag but instead flag fake traffic as SIMULATED and keep behavior to not publish fake data see #27878 (comment)
  • Direct assignment of flags field from/to MAVLink with asserts on the definition
  • Line wrapping and reuse of kDefaultFakeTrafficFlags refactor

Rebased on main after #26815 was merged.

Comment thread src/modules/mavlink/streams/ADSB_VEHICLE.hpp
Comment thread src/modules/navigator/DetectAndAvoid/detect_and_avoid_fake_traffic.cpp Outdated

@JonasPerolini JonasPerolini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks.

Added two small threads to confirm the intended behavior. Nothing blocking, feel free to close them once acknowledged.

(Sorry for the late review @MaEtUgR and @anilkir)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. scope:drivers Device drivers and hardware interfaces. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:uorb uORB messages, generated interfaces, or message translation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants